package com.kiragame.couplescreen.service;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

import com.kiragame.couplescreen.R;
import com.kiragame.couplescreen.quickblox.QuickBloxManager;
import com.kiragame.couplescreen.utils.Utilities;

public class NetworkReceiver extends BroadcastReceiver {
	private OnNetworkListener listener;

	@Override
	public void onReceive(Context context, Intent intent) {
		boolean isConnect = Utilities.isConnectingToInternet(context);
		if (isConnect) {
			QuickBloxManager.getInstance(context).setUpServer();
			//hideNotification();
			if(listener != null){
				listener.onOnline();
			}
		} else {
			if(listener != null){
				listener.onOffine();
			}
			//AnoChatSocket.getInstance(context).disconnect();
			//showNotification();
		}

	}
	public void setOnNetworkListener(OnNetworkListener listener){
		this.listener = listener;
	}
	public interface OnNetworkListener{
		void onOnline();
		void onOffine();
	}
}
